export default function createLiteTable(items = []) {
  if (!Array.isArray(items)) return [];
  return items.map(it => ({
    workNumber: it.workNumber != null ? it.workNumber : (it.staffId != null ? it.staffId : ''),
    staffId: it.staffId != null ? it.staffId : null,
    flowerName: it.flowerName || it.name || it.userName || '',
    track: it.track || it.courseTrack || '',
    title: it.title || it.rank || '',
    primaryRegion: it.primaryRegion || it.region || '',
    secondaryRegion: it.secondaryRegion || it.subRegion || '',
    store: it.store || it.shop || it.storeName || '',
    position: it.position || it.job || '',
    practiceTotalQuestions: Number(it.practiceTotalQuestions) || 0,
    practiceCompletedQuestions: Number(it.practiceCompletedQuestions) || 0,
    practiceCorrectQuestions: Number(it.practiceCorrectQuestions) || 0,
    practiceTotalScore: Number(it.practiceTotalScore) || 0,
    examTotalQuestions: Number(it.examTotalQuestions) || 0,
    examCompletedQuestions: Number(it.examCompletedQuestions) || 0,
    examCorrectQuestions: Number(it.examCorrectQuestions) || 0,
    examTotalScore: Number(it.examTotalScore) || 0,
    totalScore: Number(it.totalScore) || (Number(it.practiceTotalScore) || 0) + (Number(it.examTotalScore) || 0),
    avatarImage: it.avatarImage || it.avatar || it.avatarUrl || it.storeAvatar || '/static/default-avatar.jpg',
    storeAvatar: it.storeAvatar || '',
    declaration: typeof it.declaration !== 'undefined' ? it.declaration : '',
    dingdingUid: it.dingdingUid || it.dingDingUid || '',
    subTable: it.subTable || ''
  }));
} 